package com.heima.article.feign;

//import com.heima.apis.article.IArticleClient;
import com.heima.article.service.ApArticleService;
import com.heima.feign.article.IArticleClient;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.ArticleInfoDto;
import com.heima.model.user.dtos.LikesBehaviorDto;
import com.heima.model.user.dtos.readBehaviorDto;
import com.heima.model.user.pojos.ApuUerFollow;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.IOException;

@RestController
public class ArticleClient implements IArticleClient {

    @Autowired
    private ApArticleService apArticleService;

    @Override
    @PostMapping("/api/v1/article/save")
    public ResponseResult saveArticle(@RequestBody ArticleDto dto) {
        return apArticleService.saveArticle(dto);
    }


    /**
     * 文章点赞数据累计
     */
    @PostMapping("/api/v1/article/dznum")
    public void dznum(@RequestBody LikesBehaviorDto dto){
        apArticleService.dznum(dto);
    }

    /**
     * 文章阅读数据累计
     */
    @PostMapping("/api/v1/article/ydnum")
    public void ydnum(@RequestBody readBehaviorDto dto){
        apArticleService.ydnum(dto);
    }



}